
package vista;

import java.awt.Dimension;
import javax.swing.JTable;
import javax.swing.table.*;


public class VentanaCompetencias extends javax.swing.JFrame {

   
    private javax.swing.JButton jButtonGenerarCompetencia;
    private javax.swing.JButton jButtonSalir;
    private javax.swing.JPanel jPanelCompetencia;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTableCompetencia;
    
    public VentanaCompetencias() {
        initComponents();
       setVisible(true);
   
    
    }
    
    private void initComponents() {

        jButtonGenerarCompetencia = new javax.swing.JButton();
        jPanelCompetencia = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTableCompetencia = new javax.swing.JTable();
        jButtonSalir = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Competencias");

        jButtonGenerarCompetencia.setFont(new java.awt.Font("Arial", 3, 14));
        jButtonGenerarCompetencia.setText("Generar Competencias");

        jPanelCompetencia.setBackground(new java.awt.Color(51, 51, 255));
        jPanelCompetencia.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Datos de la Competencia", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 3, 12), java.awt.Color.white)); // NOI18N
        jPanelCompetencia.setForeground(new java.awt.Color(51, 51, 255));

        jTableCompetencia.setAutoCreateRowSorter(true);
        jTableCompetencia.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 3, 10), java.awt.Color.black)); // NOI18N
        jTableCompetencia.setFont(new java.awt.Font("Arial", 3, 12));
        
        jTableCompetencia.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jScrollPane1.setViewportView(jTableCompetencia);

        javax.swing.GroupLayout jPanelCompetenciaLayout = new javax.swing.GroupLayout(jPanelCompetencia);
        jPanelCompetencia.setLayout(jPanelCompetenciaLayout);
        jPanelCompetenciaLayout.setHorizontalGroup(
            jPanelCompetenciaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelCompetenciaLayout.createSequentialGroup()
                .addContainerGap(28, Short.MAX_VALUE)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 712, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanelCompetenciaLayout.setVerticalGroup(
            jPanelCompetenciaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelCompetenciaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 270, Short.MAX_VALUE)
                .addContainerGap())
        );

        jButtonSalir.setFont(new java.awt.Font("Arial", 3, 14));
        jButtonSalir.setText("Salir");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(27, Short.MAX_VALUE)
                .addComponent(jPanelCompetencia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(22, 22, 22))
            .addGroup(layout.createSequentialGroup()
                .addGap(248, 248, 248)
                .addComponent(jButtonGenerarCompetencia, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonSalir, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(249, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addComponent(jPanelCompetencia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonSalir, javax.swing.GroupLayout.DEFAULT_SIZE, 46, Short.MAX_VALUE)
                    .addComponent(jButtonGenerarCompetencia, javax.swing.GroupLayout.DEFAULT_SIZE, 46, Short.MAX_VALUE))
                .addContainerGap())
        );

        pack();
    }

 
   public void asignarTablaModelo(TableModel Modelo){
                jTableCompetencia.setModel(Modelo);
               
}
    
   
   
   public TableModel getTablaModelo(){
   
       
    return jTableCompetencia.getModel();
   }
   
  
   
   
    public void addListener(java.awt.event.ActionListener listener){
        jButtonSalir.addActionListener(listener);
        jButtonGenerarCompetencia.addActionListener(listener);
        
    }
    
 
    }
     
     
    
